It is reasonably straightforward to program the BV513,BV514 and BV523 in C instead of BASIC, no programmer is needed as there is a boot loader. The DDD.. you are seeing is part of the boot loader, it is waiting for you to send a binary or hex file using the ‘Load Application’ icon of BV_COMM. Full instruction for this are here Can I suggest that you try and get an LED flashing (Hardware equivaleby jimeer - BV513
This needs some experimentation. I have one customer that reports "I am also getting steady results at 1MHZ speed and 1 second pause removed from program ;)"by jimeer - Serial & I2C Devices
Another Solution I have been dabbling with the RPi some more and was even contemplating changing the firmware on the premise that if you can’t bet them join them; even if it is a backwards step. To cut short a long story I found that by adjusting the DEL register this effectively alters the clock frequency just enough for the BV42nn devices** to work. This zip file contains a program that needsby jimeer - Serial & I2C Devices
The code shoule look something like this: function x() @ANSELACLR = 1 @TRISACLR = LED2 | LED3 while comkey?(2) = 0 @LATAINV = LED @LATAINV = LED2 @LATAINV= LED3 wait(200) wend endf This will work if all the constant values are correct and the pins are connected okay, if not then you need to keep checking, it is very easy to miss something. Try using LATAby jimeer - ByPic
Should be @TRISACLR = 1 @ANSELACLR = 1by jimeer - ByPic
* Have you set RA1 and RA2 to be output using TRISA or TRISACLR? * Is RA1 or 2 an analogue? If so they need setting to digitalby jimeer - ByPic
LATAINV is an address, you need to change the contents of the address using @, thus: @LATAINV=LED or poke(LATAINV,LED)by jimeer - ByPic
Okay then this is the code you are looking for but as I said before there are lots of good PIC32, C programming sites not to mention the code provided by Microchip itself that has examples of UART code. // =================== S E R I A L ================================== // simple serial communication on com port 2, no handshaking or // buffering // ****************************************by jimeer - BV513
The ADC is constantly sampled but is interrupted when I2C communication takes place, if the IC is constantly interrogated by the I2C then it may not sample at all. I would suggest giving it at least 100mS now and again so that it can take some samples.by jimeer - Serial & I2C Devices
I don't understand why you are using C if you are just staring out when in mBASIC you can achieve what you need in 3 lines of code, yet using C will at least a couple of functions and for buffered input will need considerably more?by jimeer - BV513
Hello, you may get more response asking this question in a PIC32 programming forum. It looks like you have a PIC programmer and using C. Most of the users in this forum use BASIC and or the built in boot loader of the BV513. This link may also help:by jimeer - BV513
To load a program into memory the comand 'tload' is used. The procedure is: new // to clear the ram space tload // to tell mb to compile the incomming text Now use the text transfer box to send the text. However, for conveniance all of the above is sent to the device in the text transfer dialg box: The line at the bottom of the box new\n \w200 tload\n \w300 does that when you press sendby jimeer - BV500
Well I finally managed to find out the cause of the problem. It would have taken a lot longer without the code that petr supplied. This code enables access to the registers without the need to go into kernel space although it does need to be run with sudo (there are probably ways round this). // skip this bit if you know what clock stretching is // Just in case you don’t know, clock stretchiby jimeer - Serial & I2C Devices
Thanks, I was told that it was not possible to write to the CPU registers from user space hence all of the work with device drivers. I will look at the code with interest, tomorrow hopefully. Jimby jimeer - Serial & I2C Devices
The problem is turning out to quite difficult to track down. I am now just at the stage (almost) where I can talk directly to the Broadcom chip - This, for me, was incredibly difficult sifting through the Linux noise (all of the online information that looks promising but turns out to be only partly relevant.) to be able to compile a device driver. The image is 3.1.9+ but the online headers requiby jimeer - Serial & I2C Devices
Well that’s a week out of my life I will never get back. I have a solution, I think, but the problem is probably with the actual driver and so it won't matter if C, Python or any other language is used as they all open 'i2c-n'. I have got the BV4502 working using the BV4205 test command '0x55' but this is by introducing a delay between the write and read. I will check it and write it up tomorrby jimeer - Serial & I2C Devices
It is strange as the 4205 woks okay with other hardware so there is some subtle difference when using lm-devices. I havn't looked but is is possible that the clock is running at > 100k? I think that bit banning is used rather than hardware and so ther must be some delay incorporated. Can the speed of the clock be controlled as the PI runs faster than most embedded linux boxes, could this bby jimeer - Serial & I2C Devices
There is quite clearly something the 4205 does not like about the way i2c-tools works but unfortunately I don't have a Linux box with GPIO at the moment so can't analyse the problem. I think the RPi's are about 3 weeks off so I am not able to do anything until then -- unless I can get the old NSLU2 going.by jimeer - Serial & I2C Devices
Neil, thanks for the report, much appreciated. [1][2] This is now fixed 2.04 201210059 [3] Cant find anything wrong with this actual code but you did mention floating point. There is an error in the documentation. The for/next loop only works with integer variables, a very early version used float as well but this had a massive impact on speed and so this was dropped but the documentation was nby jimeer - ByPic
What are you sending to the BV4205?by jimeer - Serial & I2C Devices
The address is 0x31 This is on the datasheet at 0x62 which is the 8 bit address so device by 2 to get 0x31. Also if you get the chance try some of the command line options that are available for i2cdectect:by jimeer - Serial & I2C Devices
What happens if you don't try to i2cdetect?. I suspect that the I2Cdetect causes the BV4205 to keep the clock or data low for some reason.by jimeer - Serial & I2C Devices
The problem is with the Baud rate: In the zip file you will see two files, in your case BV513_V2_2M_V_2.04.bin and BV513_V2_11k_V_2.04.bin. These are set up for 2000000 and 115200 Baud respectively. All boot loaders work at 115200 so when you install the BV513_V2_2M_V_2.04.bin file you will not see anything unless you change the Baud rate (AFTER installation of the new upgrade) to 2000000.by jimeer - ByPic
Post a few more details: * which item BV513, 523 etc. * which BASIC - what is the file nameby jimeer - ByPic
The boot loader does not use interrupts, its kept very simple so that it will fit into the protected boot space. I think that the not being able to get code onto the board is unrelated and probably due to something else - the boot loader is entirely separate from the user code.by jimeer - BV513
You don't say but if you have a BV101 then I presume that this is part of the BV513 kit. If the BV513 is running the last program then we can eliminate that. Form your description there is a problem with the BV101 connectivity, this will be due to either the PC USB or the BV101 itself. When you plug in the BV101 you should get a COM port associated with that. Make sure this is or is not happenby jimeer - BV513
The simplest way is to use UART2. You must have the BV513 connected to the PC anyway so use that connection. Anything you send via UART2 will go to the PC. Example: function to_pc() comouts(2,"hello pc" ) endf Another alternative is to use UART 1 and a Bluetooth transceiver and a dongle on the PC - or send it to a phone if you know anything about Bluetooth and Androidby jimeer - BV513
The rows and columns depend on the keypad, it does not matter which way round they are as each key will produce a unique scan code that can be decoded by the attached host. The interrupt line will be low whenever there is a key value in the key buffer, it goes high when there are no keys in there. The keys are removed with the get key command esc[k To switch the cursor off see the FAQ here.by jimeer - Serial & I2C Devices
The logic IC will work down to 3V but the L293 data sheet specifies the minimum voltage of 4.5 so the answer is probably no.by jimeer - Serial & I2C Devices
The data sheet here gives the working voltages of 2.3 to 3.6 with an absolute maximum of 4.0 so 3 rechargeable would be ideal as that would give a good margin down to 2.3Vby jimeer - BV500