Skip to main content
Topic: PicProgrammer v2 for BusPirate v4 Development (Read 38599 times) previous topic - next topic

Re: PicProgrammer v2 for BusPirate v4 Development

Reply #60
Maybe the ADC control stuff can go with the other PIC commands in the raw2wire binary mode? Then it is all in the same place.
Got a question? Please ask in the forum for the fastest answers.

Re: PicProgrammer v2 for BusPirate v4 Development

Reply #61
We have all PIC commands in 7 (0b0000 0111) which is not documented :S. I am nearly done with writing the codes have to finalize where everything goes. I am thinking about using binary command 8 for SMPS mode. Probably we will use this for testing. I cannot wrap my head around how to do implement this in others as binPIC has all commands consumed except those start with 0b0010xxxx and 0b0011xxxx maybe I can use these ones?

Re: PicProgrammer v2 for BusPirate v4 Development

Reply #62
OK, so the codes are at the SVN now. I used 8 to enter SMPS mode, just to quickly try it out. Later on this will be moved to somewhere else, possibly under pic.c as that is what we're using wit PiratePICProg (I guess?).

One thing to note is pic mode is not documented at wiki, I'll try to document it once I have time tomorrow, I always get bored at the lab. :)

Here is the usage:
8 enters the SMPS mode, returns "SMPS1". From there you have a couple of commands:
- 0 returns to binmode
- 1 for version string, returns "SMPS1"
- 2 for starting up. It turns on the voltage regulators, gets 2 bytes from the terminal as the requested voltage and starts SMPS operations.
-3 for shutting down. We stop SMPS and turn off the voltage regulators.
- 4 for getting the ADC value, same as the binmode command, it returns the ADC reading as 2 bytes. I used a separate variable to store ADC buffer for this. Just to be on the safe side.

Re: PicProgrammer v2 for BusPirate v4 Development

Reply #63
Well, as for latest development, I ported all binmode commands to binwire.c as we are using that for PIC programming purposes. All unnecessary commands are removed from smps.h and smps.c files, removed the entry to SMPS mode from binIO.c (8 is free now) also freed up 'M' command I was using in user interface menu. The new commands when you enter binary raw-wire mode are:
- 11110000 - Return SMPS output voltage
- 11110001 - Stop SMPS operation
- 1111xxxx - Start SMPS operation (xxxx and next byte give requested output voltage): Lowest possible value is 512 = 0b0010 0000 which is normal as our minimum voltage output is > 5 V. Also we have a 12-bit number which can be used to represent voltages up to 4095 cV

Uploading code to SVN now.